<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSicksTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sicks', function (Blueprint $table) {
            $table->id();
            $table->string('name',50)->comment('患者姓名');
            $table->char('phone',11)->comment('手机号');
            $table->char('id_card',18)->comment('身份证号');
            $table->char('patient_id_card',10)->default(rand(1000000000,9999999999))->comment('患者就诊卡号');
            $table->tinyInteger('status')->default(0)->comment('住院状态 0:未入院 1:住院中 2:已出院');
            $table->timestamps();
            //软删
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('sicks');
    }
}
